package com.warm.pump.module.sys.dao.gen;

import java.util.List;
import java.util.Map;
import java.util.Date;
import java.math.BigDecimal;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.frame.gen.util.TypeCast;
import com.warm.pump.frame.gen.exception.ServiceException;
import com.warm.pump.module.sys.bean.po.gen.Area;
import com.warm.pump.module.sys.mapper.gen.AreaMapper;
import com.warm.pump.module.sys.bean.po.gen.AreaExample;

@Repository
public class AreaDao {
    // 日志对象
    private transient Log log = LogFactory.getLog(this.getClass());
    @Autowired
    private AreaMapper areaMapper;

    // 增加一个后台Area表

    public boolean insert(Area area) {
        try {
            areaMapper.insert(area);
            log.debug("后台Area表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台Area表增加失败");
            throw new ServiceException("后台Area表增加失败", e);
        }
    }
    // 增加一个后台Area表Selective

    public boolean insertSelective(Area area) {
        try {
            areaMapper.insertSelective(area);
            log.debug("后台Area表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台Area表增加失败");
            throw new ServiceException("后台Area表增加失败", e);
        }
    }

    // 删除一个后台Area表

    public boolean deleteByPrimaryKey(Integer id) {
        try {
            areaMapper.deleteByPrimaryKey(id);
            log.debug("后台Area表删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台Area表删除失败");
            throw new ServiceException("后台Area表删除失败", e);
        }
    }
    // 删除一个后台Area表byMap

    public boolean deleteByMap(Map areaMap) {
        try {
            areaMapper.deleteByExample(createAreaExample(areaMap, null, null));
            log.debug("后台Area根据Map删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台Area根据GroupID删除失败");
            throw new ServiceException("后台Area根据object删除失败", e);
        }
    }
    // 修改一个后台Area表

    public boolean updateByPrimaryKey(Area area) {
        try {
            areaMapper.updateByPrimaryKey(area);
            log.debug("后台Area表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台Area表修改失败");
            throw new ServiceException("后台Area表修改失败", e);
        }
    }
    // 修改一个后台Area表Selective

    public boolean updateByPrimaryKeySelective(Area area) {
        try {
            areaMapper.updateByPrimaryKeySelective(area);
            log.debug("后台Area表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台Area表修改失败");
            throw new ServiceException("后台Area表修改失败", e);
        }
    }
    // 修改一个后台Area表

    public boolean updateByMap(Area area, Map areaMap) {
        try {
            areaMapper.updateByExample(area, createAreaExample(areaMap, null, null));
            log.debug("后台批量Area表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量Area表修改失败");
            throw new ServiceException("后台Area表批量修改失败", e);
        }
    }
    // 修改一个后台Area表Selective

    public boolean updateByMapSelective(Area area, Map areaMap) {
        try {
            areaMapper.updateByExampleSelective(area, createAreaExample(areaMap, null, null));
            log.debug("后台批量Area表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量Area表修改失败");
            throw new ServiceException("后台Area表批量修改失败", e);
        }
    }

    // 查询一个后台Area表

    public Area selectByPrimaryKey(Integer id) {
        return areaMapper.selectByPrimaryKey(id);
    }

    // 查询一个后台Area表-根据map

    public Area selectByMap(Map areaMap) {
        List<Area> list = getListByMap(areaMap);
        if (list == null || list.isEmpty()) {
            return null;
        } else {
            return list.get(0);
        }
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    // 查询所有后台Area表

    public List<Area> getListByMap(Map areaMap) {

        return areaMapper.selectByExample(createAreaExample(areaMap, null, null));
    }

    //统计后台Area表数量

    public int countTotalByMap(Map areaMap) {

        return areaMapper.countByExample(createAreaExample(areaMap, null, null));
    }


    public List<Area> getListByMapPage(Map areaMap, int limitStart,
                                       int limitOffset) {

        return areaMapper.selectByExample(createAreaExample(areaMap, limitStart, limitOffset));
    }


    public PageBean getPageBeanByMap(Map areaMap, int pageNo, int pageSize) {
        Integer count = countTotalByMap(areaMap);
        PageBean pageBean = new PageBean();
        pageBean.setCount(count);
        pageBean.setPageNo(pageNo);
        pageBean.setPageSize(pageSize);
        int limitStart = pageBean.getStartNo();
        int limitOffset = pageSize;
        pageBean.setData(areaMapper.selectByExample(createAreaExample(areaMap, limitStart, limitOffset)));
        return pageBean;
    }

    private AreaExample createAreaExample(Map areaMap, Integer limitStart, Integer limitOffset) {
        AreaExample areaEx = new AreaExample();
        AreaExample.Criteria c = areaEx.createCriteria();
        Integer id_null = TypeCast.getInteger(areaMap.get("id_null"));
        Integer id_notNull = TypeCast.getInteger(areaMap.get("id_notNull"));
        Integer id = TypeCast.getInteger(areaMap.get("id"));
        Integer id_not = TypeCast.getInteger(areaMap.get("id_not"));
        Integer id_greater = TypeCast.getInteger(areaMap.get("id_greater"));
        Integer id_greaterEqual = TypeCast.getInteger(areaMap.get("id_greaterEqual"));
        Integer id_less = TypeCast.getInteger(areaMap.get("id_less"));
        Integer id_lessEqual = TypeCast.getInteger(areaMap.get("id_lessEqual"));
        List<Integer> id_in = TypeCast.getIntegerList(areaMap.get("id_in"));
        List<Integer> id_notIn = TypeCast.getIntegerList(areaMap.get("id_notIn"));
        Integer id_between1 = TypeCast.getInteger(areaMap.get("id_between1"));
        Integer id_between2 = TypeCast.getInteger(areaMap.get("id_between2"));
        Integer id_notBetween1 = TypeCast.getInteger(areaMap.get("id_notBetween1"));
        Integer id_notBetween2 = TypeCast.getInteger(areaMap.get("id_notBetween2"));

        if (id_null != null) {
            c.andIdIsNull();
        }
        if (id_notNull != null) {
            c.andIdIsNotNull();
        }
        if (id != null) {
            c.andIdEqualTo(id);
        }
        if (id_not != null) {
            c.andIdNotEqualTo(id_not);
        }
        if (id_greater != null) {
            c.andIdGreaterThan(id_greater);
        }
        if (id_greaterEqual != null) {
            c.andIdGreaterThanOrEqualTo(id_greaterEqual);
        }
        if (id_less != null) {
            c.andIdLessThan(id_less);
        }
        if (id_lessEqual != null) {
            c.andIdLessThanOrEqualTo(id_lessEqual);
        }
        if (id_in != null) {
            c.andIdIn(id_in);
        }
        if (id_notIn != null) {
            c.andIdNotIn(id_notIn);
        }
        if (id_between1 != null) {
            c.andIdBetween(id_between1, id_between2);
        }
        if (id_notBetween1 != null) {
            c.andIdNotBetween(id_notBetween1, id_notBetween2);
        }
        String name_null = TypeCast.getString(areaMap.get("name_null"));
        String name_notNull = TypeCast.getString(areaMap.get("name_notNull"));
        String name = TypeCast.getString(areaMap.get("name"));
        String name_not = TypeCast.getString(areaMap.get("name_not"));
        String name_greater = TypeCast.getString(areaMap.get("name_greater"));
        String name_greaterEqual = TypeCast.getString(areaMap.get("name_greaterEqual"));
        String name_less = TypeCast.getString(areaMap.get("name_less"));
        String name_lessEqual = TypeCast.getString(areaMap.get("name_lessEqual"));
        String name_like = TypeCast.getString(areaMap.get("name_like"));
        String name_notLike = TypeCast.getString(areaMap.get("name_notLike"));
        List<String> name_in = TypeCast.getStringList(areaMap.get("name_in"));
        List<String> name_notIn = TypeCast.getStringList(areaMap.get("name_notIn"));
        String name_between1 = TypeCast.getString(areaMap.get("name_between1"));
        String name_between2 = TypeCast.getString(areaMap.get("name_between2"));
        String name_notBetween1 = TypeCast.getString(areaMap.get("name_notBetween1"));
        String name_notBetween2 = TypeCast.getString(areaMap.get("name_notBetween2"));

        if (name_null != null) {
            c.andNameIsNull();
        }
        if (name_notNull != null) {
            c.andNameIsNotNull();
        }
        if (name != null) {
            c.andNameEqualTo(name);
        }
        if (name_not != null) {
            c.andNameNotEqualTo(name_not);
        }
        if (name_greater != null) {
            c.andNameGreaterThan(name_greater);
        }
        if (name_greaterEqual != null) {
            c.andNameGreaterThanOrEqualTo(name_greaterEqual);
        }
        if (name_less != null) {
            c.andNameLessThan(name_less);
        }
        if (name_lessEqual != null) {
            c.andNameLessThanOrEqualTo(name_lessEqual);
        }
        if (name_like != null) {
            c.andNameLike(name_like);
        }
        if (name_notLike != null) {
            c.andNameNotLike(name_notLike);
        }
        if (name_in != null) {
            c.andNameIn(name_in);
        }
        if (name_notIn != null) {
            c.andNameNotIn(name_notIn);
        }
        if (name_between1 != null) {
            c.andNameBetween(name_between1, name_between2);
        }
        if (name_notBetween1 != null) {
            c.andNameNotBetween(name_notBetween1, name_notBetween2);
        }
        Integer parentId_null = TypeCast.getInteger(areaMap.get("parentId_null"));
        Integer parentId_notNull = TypeCast.getInteger(areaMap.get("parentId_notNull"));
        Integer parentId = TypeCast.getInteger(areaMap.get("parentId"));
        Integer parentId_not = TypeCast.getInteger(areaMap.get("parentId_not"));
        Integer parentId_greater = TypeCast.getInteger(areaMap.get("parentId_greater"));
        Integer parentId_greaterEqual = TypeCast.getInteger(areaMap.get("parentId_greaterEqual"));
        Integer parentId_less = TypeCast.getInteger(areaMap.get("parentId_less"));
        Integer parentId_lessEqual = TypeCast.getInteger(areaMap.get("parentId_lessEqual"));
        List<Integer> parentId_in = TypeCast.getIntegerList(areaMap.get("parentId_in"));
        List<Integer> parentId_notIn = TypeCast.getIntegerList(areaMap.get("parentId_notIn"));
        Integer parentId_between1 = TypeCast.getInteger(areaMap.get("parentId_between1"));
        Integer parentId_between2 = TypeCast.getInteger(areaMap.get("parentId_between2"));
        Integer parentId_notBetween1 = TypeCast.getInteger(areaMap.get("parentId_notBetween1"));
        Integer parentId_notBetween2 = TypeCast.getInteger(areaMap.get("parentId_notBetween2"));

        if (parentId_null != null) {
            c.andParentIdIsNull();
        }
        if (parentId_notNull != null) {
            c.andParentIdIsNotNull();
        }
        if (parentId != null) {
            c.andParentIdEqualTo(parentId);
        }
        if (parentId_not != null) {
            c.andParentIdNotEqualTo(parentId_not);
        }
        if (parentId_greater != null) {
            c.andParentIdGreaterThan(parentId_greater);
        }
        if (parentId_greaterEqual != null) {
            c.andParentIdGreaterThanOrEqualTo(parentId_greaterEqual);
        }
        if (parentId_less != null) {
            c.andParentIdLessThan(parentId_less);
        }
        if (parentId_lessEqual != null) {
            c.andParentIdLessThanOrEqualTo(parentId_lessEqual);
        }
        if (parentId_in != null) {
            c.andParentIdIn(parentId_in);
        }
        if (parentId_notIn != null) {
            c.andParentIdNotIn(parentId_notIn);
        }
        if (parentId_between1 != null) {
            c.andParentIdBetween(parentId_between1, parentId_between2);
        }
        if (parentId_notBetween1 != null) {
            c.andParentIdNotBetween(parentId_notBetween1, parentId_notBetween2);
        }
        String shortName_null = TypeCast.getString(areaMap.get("shortName_null"));
        String shortName_notNull = TypeCast.getString(areaMap.get("shortName_notNull"));
        String shortName = TypeCast.getString(areaMap.get("shortName"));
        String shortName_not = TypeCast.getString(areaMap.get("shortName_not"));
        String shortName_greater = TypeCast.getString(areaMap.get("shortName_greater"));
        String shortName_greaterEqual = TypeCast.getString(areaMap.get("shortName_greaterEqual"));
        String shortName_less = TypeCast.getString(areaMap.get("shortName_less"));
        String shortName_lessEqual = TypeCast.getString(areaMap.get("shortName_lessEqual"));
        String shortName_like = TypeCast.getString(areaMap.get("shortName_like"));
        String shortName_notLike = TypeCast.getString(areaMap.get("shortName_notLike"));
        List<String> shortName_in = TypeCast.getStringList(areaMap.get("shortName_in"));
        List<String> shortName_notIn = TypeCast.getStringList(areaMap.get("shortName_notIn"));
        String shortName_between1 = TypeCast.getString(areaMap.get("shortName_between1"));
        String shortName_between2 = TypeCast.getString(areaMap.get("shortName_between2"));
        String shortName_notBetween1 = TypeCast.getString(areaMap.get("shortName_notBetween1"));
        String shortName_notBetween2 = TypeCast.getString(areaMap.get("shortName_notBetween2"));

        if (shortName_null != null) {
            c.andShortNameIsNull();
        }
        if (shortName_notNull != null) {
            c.andShortNameIsNotNull();
        }
        if (shortName != null) {
            c.andShortNameEqualTo(shortName);
        }
        if (shortName_not != null) {
            c.andShortNameNotEqualTo(shortName_not);
        }
        if (shortName_greater != null) {
            c.andShortNameGreaterThan(shortName_greater);
        }
        if (shortName_greaterEqual != null) {
            c.andShortNameGreaterThanOrEqualTo(shortName_greaterEqual);
        }
        if (shortName_less != null) {
            c.andShortNameLessThan(shortName_less);
        }
        if (shortName_lessEqual != null) {
            c.andShortNameLessThanOrEqualTo(shortName_lessEqual);
        }
        if (shortName_like != null) {
            c.andShortNameLike(shortName_like);
        }
        if (shortName_notLike != null) {
            c.andShortNameNotLike(shortName_notLike);
        }
        if (shortName_in != null) {
            c.andShortNameIn(shortName_in);
        }
        if (shortName_notIn != null) {
            c.andShortNameNotIn(shortName_notIn);
        }
        if (shortName_between1 != null) {
            c.andShortNameBetween(shortName_between1, shortName_between2);
        }
        if (shortName_notBetween1 != null) {
            c.andShortNameNotBetween(shortName_notBetween1, shortName_notBetween2);
        }
        Integer levelType_null = TypeCast.getInteger(areaMap.get("levelType_null"));
        Integer levelType_notNull = TypeCast.getInteger(areaMap.get("levelType_notNull"));
        Integer levelType = TypeCast.getInteger(areaMap.get("levelType"));
        Integer levelType_not = TypeCast.getInteger(areaMap.get("levelType_not"));
        Integer levelType_greater = TypeCast.getInteger(areaMap.get("levelType_greater"));
        Integer levelType_greaterEqual = TypeCast.getInteger(areaMap.get("levelType_greaterEqual"));
        Integer levelType_less = TypeCast.getInteger(areaMap.get("levelType_less"));
        Integer levelType_lessEqual = TypeCast.getInteger(areaMap.get("levelType_lessEqual"));
        List<Integer> levelType_in = TypeCast.getIntegerList(areaMap.get("levelType_in"));
        List<Integer> levelType_notIn = TypeCast.getIntegerList(areaMap.get("levelType_notIn"));
        Integer levelType_between1 = TypeCast.getInteger(areaMap.get("levelType_between1"));
        Integer levelType_between2 = TypeCast.getInteger(areaMap.get("levelType_between2"));
        Integer levelType_notBetween1 = TypeCast.getInteger(areaMap.get("levelType_notBetween1"));
        Integer levelType_notBetween2 = TypeCast.getInteger(areaMap.get("levelType_notBetween2"));

        if (levelType_null != null) {
            c.andLevelTypeIsNull();
        }
        if (levelType_notNull != null) {
            c.andLevelTypeIsNotNull();
        }
        if (levelType != null) {
            c.andLevelTypeEqualTo(levelType);
        }
        if (levelType_not != null) {
            c.andLevelTypeNotEqualTo(levelType_not);
        }
        if (levelType_greater != null) {
            c.andLevelTypeGreaterThan(levelType_greater);
        }
        if (levelType_greaterEqual != null) {
            c.andLevelTypeGreaterThanOrEqualTo(levelType_greaterEqual);
        }
        if (levelType_less != null) {
            c.andLevelTypeLessThan(levelType_less);
        }
        if (levelType_lessEqual != null) {
            c.andLevelTypeLessThanOrEqualTo(levelType_lessEqual);
        }
        if (levelType_in != null) {
            c.andLevelTypeIn(levelType_in);
        }
        if (levelType_notIn != null) {
            c.andLevelTypeNotIn(levelType_notIn);
        }
        if (levelType_between1 != null) {
            c.andLevelTypeBetween(levelType_between1, levelType_between2);
        }
        if (levelType_notBetween1 != null) {
            c.andLevelTypeNotBetween(levelType_notBetween1, levelType_notBetween2);
        }
        String cityCode_null = TypeCast.getString(areaMap.get("cityCode_null"));
        String cityCode_notNull = TypeCast.getString(areaMap.get("cityCode_notNull"));
        String cityCode = TypeCast.getString(areaMap.get("cityCode"));
        String cityCode_not = TypeCast.getString(areaMap.get("cityCode_not"));
        String cityCode_greater = TypeCast.getString(areaMap.get("cityCode_greater"));
        String cityCode_greaterEqual = TypeCast.getString(areaMap.get("cityCode_greaterEqual"));
        String cityCode_less = TypeCast.getString(areaMap.get("cityCode_less"));
        String cityCode_lessEqual = TypeCast.getString(areaMap.get("cityCode_lessEqual"));
        String cityCode_like = TypeCast.getString(areaMap.get("cityCode_like"));
        String cityCode_notLike = TypeCast.getString(areaMap.get("cityCode_notLike"));
        List<String> cityCode_in = TypeCast.getStringList(areaMap.get("cityCode_in"));
        List<String> cityCode_notIn = TypeCast.getStringList(areaMap.get("cityCode_notIn"));
        String cityCode_between1 = TypeCast.getString(areaMap.get("cityCode_between1"));
        String cityCode_between2 = TypeCast.getString(areaMap.get("cityCode_between2"));
        String cityCode_notBetween1 = TypeCast.getString(areaMap.get("cityCode_notBetween1"));
        String cityCode_notBetween2 = TypeCast.getString(areaMap.get("cityCode_notBetween2"));

        if (cityCode_null != null) {
            c.andCityCodeIsNull();
        }
        if (cityCode_notNull != null) {
            c.andCityCodeIsNotNull();
        }
        if (cityCode != null) {
            c.andCityCodeEqualTo(cityCode);
        }
        if (cityCode_not != null) {
            c.andCityCodeNotEqualTo(cityCode_not);
        }
        if (cityCode_greater != null) {
            c.andCityCodeGreaterThan(cityCode_greater);
        }
        if (cityCode_greaterEqual != null) {
            c.andCityCodeGreaterThanOrEqualTo(cityCode_greaterEqual);
        }
        if (cityCode_less != null) {
            c.andCityCodeLessThan(cityCode_less);
        }
        if (cityCode_lessEqual != null) {
            c.andCityCodeLessThanOrEqualTo(cityCode_lessEqual);
        }
        if (cityCode_like != null) {
            c.andCityCodeLike(cityCode_like);
        }
        if (cityCode_notLike != null) {
            c.andCityCodeNotLike(cityCode_notLike);
        }
        if (cityCode_in != null) {
            c.andCityCodeIn(cityCode_in);
        }
        if (cityCode_notIn != null) {
            c.andCityCodeNotIn(cityCode_notIn);
        }
        if (cityCode_between1 != null) {
            c.andCityCodeBetween(cityCode_between1, cityCode_between2);
        }
        if (cityCode_notBetween1 != null) {
            c.andCityCodeNotBetween(cityCode_notBetween1, cityCode_notBetween2);
        }
        String zipCode_null = TypeCast.getString(areaMap.get("zipCode_null"));
        String zipCode_notNull = TypeCast.getString(areaMap.get("zipCode_notNull"));
        String zipCode = TypeCast.getString(areaMap.get("zipCode"));
        String zipCode_not = TypeCast.getString(areaMap.get("zipCode_not"));
        String zipCode_greater = TypeCast.getString(areaMap.get("zipCode_greater"));
        String zipCode_greaterEqual = TypeCast.getString(areaMap.get("zipCode_greaterEqual"));
        String zipCode_less = TypeCast.getString(areaMap.get("zipCode_less"));
        String zipCode_lessEqual = TypeCast.getString(areaMap.get("zipCode_lessEqual"));
        String zipCode_like = TypeCast.getString(areaMap.get("zipCode_like"));
        String zipCode_notLike = TypeCast.getString(areaMap.get("zipCode_notLike"));
        List<String> zipCode_in = TypeCast.getStringList(areaMap.get("zipCode_in"));
        List<String> zipCode_notIn = TypeCast.getStringList(areaMap.get("zipCode_notIn"));
        String zipCode_between1 = TypeCast.getString(areaMap.get("zipCode_between1"));
        String zipCode_between2 = TypeCast.getString(areaMap.get("zipCode_between2"));
        String zipCode_notBetween1 = TypeCast.getString(areaMap.get("zipCode_notBetween1"));
        String zipCode_notBetween2 = TypeCast.getString(areaMap.get("zipCode_notBetween2"));

        if (zipCode_null != null) {
            c.andZipCodeIsNull();
        }
        if (zipCode_notNull != null) {
            c.andZipCodeIsNotNull();
        }
        if (zipCode != null) {
            c.andZipCodeEqualTo(zipCode);
        }
        if (zipCode_not != null) {
            c.andZipCodeNotEqualTo(zipCode_not);
        }
        if (zipCode_greater != null) {
            c.andZipCodeGreaterThan(zipCode_greater);
        }
        if (zipCode_greaterEqual != null) {
            c.andZipCodeGreaterThanOrEqualTo(zipCode_greaterEqual);
        }
        if (zipCode_less != null) {
            c.andZipCodeLessThan(zipCode_less);
        }
        if (zipCode_lessEqual != null) {
            c.andZipCodeLessThanOrEqualTo(zipCode_lessEqual);
        }
        if (zipCode_like != null) {
            c.andZipCodeLike(zipCode_like);
        }
        if (zipCode_notLike != null) {
            c.andZipCodeNotLike(zipCode_notLike);
        }
        if (zipCode_in != null) {
            c.andZipCodeIn(zipCode_in);
        }
        if (zipCode_notIn != null) {
            c.andZipCodeNotIn(zipCode_notIn);
        }
        if (zipCode_between1 != null) {
            c.andZipCodeBetween(zipCode_between1, zipCode_between2);
        }
        if (zipCode_notBetween1 != null) {
            c.andZipCodeNotBetween(zipCode_notBetween1, zipCode_notBetween2);
        }
        String mergerName_null = TypeCast.getString(areaMap.get("mergerName_null"));
        String mergerName_notNull = TypeCast.getString(areaMap.get("mergerName_notNull"));
        String mergerName = TypeCast.getString(areaMap.get("mergerName"));
        String mergerName_not = TypeCast.getString(areaMap.get("mergerName_not"));
        String mergerName_greater = TypeCast.getString(areaMap.get("mergerName_greater"));
        String mergerName_greaterEqual = TypeCast.getString(areaMap.get("mergerName_greaterEqual"));
        String mergerName_less = TypeCast.getString(areaMap.get("mergerName_less"));
        String mergerName_lessEqual = TypeCast.getString(areaMap.get("mergerName_lessEqual"));
        String mergerName_like = TypeCast.getString(areaMap.get("mergerName_like"));
        String mergerName_notLike = TypeCast.getString(areaMap.get("mergerName_notLike"));
        List<String> mergerName_in = TypeCast.getStringList(areaMap.get("mergerName_in"));
        List<String> mergerName_notIn = TypeCast.getStringList(areaMap.get("mergerName_notIn"));
        String mergerName_between1 = TypeCast.getString(areaMap.get("mergerName_between1"));
        String mergerName_between2 = TypeCast.getString(areaMap.get("mergerName_between2"));
        String mergerName_notBetween1 = TypeCast.getString(areaMap.get("mergerName_notBetween1"));
        String mergerName_notBetween2 = TypeCast.getString(areaMap.get("mergerName_notBetween2"));

        if (mergerName_null != null) {
            c.andMergerNameIsNull();
        }
        if (mergerName_notNull != null) {
            c.andMergerNameIsNotNull();
        }
        if (mergerName != null) {
            c.andMergerNameEqualTo(mergerName);
        }
        if (mergerName_not != null) {
            c.andMergerNameNotEqualTo(mergerName_not);
        }
        if (mergerName_greater != null) {
            c.andMergerNameGreaterThan(mergerName_greater);
        }
        if (mergerName_greaterEqual != null) {
            c.andMergerNameGreaterThanOrEqualTo(mergerName_greaterEqual);
        }
        if (mergerName_less != null) {
            c.andMergerNameLessThan(mergerName_less);
        }
        if (mergerName_lessEqual != null) {
            c.andMergerNameLessThanOrEqualTo(mergerName_lessEqual);
        }
        if (mergerName_like != null) {
            c.andMergerNameLike(mergerName_like);
        }
        if (mergerName_notLike != null) {
            c.andMergerNameNotLike(mergerName_notLike);
        }
        if (mergerName_in != null) {
            c.andMergerNameIn(mergerName_in);
        }
        if (mergerName_notIn != null) {
            c.andMergerNameNotIn(mergerName_notIn);
        }
        if (mergerName_between1 != null) {
            c.andMergerNameBetween(mergerName_between1, mergerName_between2);
        }
        if (mergerName_notBetween1 != null) {
            c.andMergerNameNotBetween(mergerName_notBetween1, mergerName_notBetween2);
        }
        String ing_null = TypeCast.getString(areaMap.get("ing_null"));
        String ing_notNull = TypeCast.getString(areaMap.get("ing_notNull"));
        String ing = TypeCast.getString(areaMap.get("ing"));
        String ing_not = TypeCast.getString(areaMap.get("ing_not"));
        String ing_greater = TypeCast.getString(areaMap.get("ing_greater"));
        String ing_greaterEqual = TypeCast.getString(areaMap.get("ing_greaterEqual"));
        String ing_less = TypeCast.getString(areaMap.get("ing_less"));
        String ing_lessEqual = TypeCast.getString(areaMap.get("ing_lessEqual"));
        String ing_like = TypeCast.getString(areaMap.get("ing_like"));
        String ing_notLike = TypeCast.getString(areaMap.get("ing_notLike"));
        List<String> ing_in = TypeCast.getStringList(areaMap.get("ing_in"));
        List<String> ing_notIn = TypeCast.getStringList(areaMap.get("ing_notIn"));
        String ing_between1 = TypeCast.getString(areaMap.get("ing_between1"));
        String ing_between2 = TypeCast.getString(areaMap.get("ing_between2"));
        String ing_notBetween1 = TypeCast.getString(areaMap.get("ing_notBetween1"));
        String ing_notBetween2 = TypeCast.getString(areaMap.get("ing_notBetween2"));

        if (ing_null != null) {
            c.andIngIsNull();
        }
        if (ing_notNull != null) {
            c.andIngIsNotNull();
        }
        if (ing != null) {
            c.andIngEqualTo(ing);
        }
        if (ing_not != null) {
            c.andIngNotEqualTo(ing_not);
        }
        if (ing_greater != null) {
            c.andIngGreaterThan(ing_greater);
        }
        if (ing_greaterEqual != null) {
            c.andIngGreaterThanOrEqualTo(ing_greaterEqual);
        }
        if (ing_less != null) {
            c.andIngLessThan(ing_less);
        }
        if (ing_lessEqual != null) {
            c.andIngLessThanOrEqualTo(ing_lessEqual);
        }
        if (ing_like != null) {
            c.andIngLike(ing_like);
        }
        if (ing_notLike != null) {
            c.andIngNotLike(ing_notLike);
        }
        if (ing_in != null) {
            c.andIngIn(ing_in);
        }
        if (ing_notIn != null) {
            c.andIngNotIn(ing_notIn);
        }
        if (ing_between1 != null) {
            c.andIngBetween(ing_between1, ing_between2);
        }
        if (ing_notBetween1 != null) {
            c.andIngNotBetween(ing_notBetween1, ing_notBetween2);
        }
        String lat_null = TypeCast.getString(areaMap.get("lat_null"));
        String lat_notNull = TypeCast.getString(areaMap.get("lat_notNull"));
        String lat = TypeCast.getString(areaMap.get("lat"));
        String lat_not = TypeCast.getString(areaMap.get("lat_not"));
        String lat_greater = TypeCast.getString(areaMap.get("lat_greater"));
        String lat_greaterEqual = TypeCast.getString(areaMap.get("lat_greaterEqual"));
        String lat_less = TypeCast.getString(areaMap.get("lat_less"));
        String lat_lessEqual = TypeCast.getString(areaMap.get("lat_lessEqual"));
        String lat_like = TypeCast.getString(areaMap.get("lat_like"));
        String lat_notLike = TypeCast.getString(areaMap.get("lat_notLike"));
        List<String> lat_in = TypeCast.getStringList(areaMap.get("lat_in"));
        List<String> lat_notIn = TypeCast.getStringList(areaMap.get("lat_notIn"));
        String lat_between1 = TypeCast.getString(areaMap.get("lat_between1"));
        String lat_between2 = TypeCast.getString(areaMap.get("lat_between2"));
        String lat_notBetween1 = TypeCast.getString(areaMap.get("lat_notBetween1"));
        String lat_notBetween2 = TypeCast.getString(areaMap.get("lat_notBetween2"));

        if (lat_null != null) {
            c.andLatIsNull();
        }
        if (lat_notNull != null) {
            c.andLatIsNotNull();
        }
        if (lat != null) {
            c.andLatEqualTo(lat);
        }
        if (lat_not != null) {
            c.andLatNotEqualTo(lat_not);
        }
        if (lat_greater != null) {
            c.andLatGreaterThan(lat_greater);
        }
        if (lat_greaterEqual != null) {
            c.andLatGreaterThanOrEqualTo(lat_greaterEqual);
        }
        if (lat_less != null) {
            c.andLatLessThan(lat_less);
        }
        if (lat_lessEqual != null) {
            c.andLatLessThanOrEqualTo(lat_lessEqual);
        }
        if (lat_like != null) {
            c.andLatLike(lat_like);
        }
        if (lat_notLike != null) {
            c.andLatNotLike(lat_notLike);
        }
        if (lat_in != null) {
            c.andLatIn(lat_in);
        }
        if (lat_notIn != null) {
            c.andLatNotIn(lat_notIn);
        }
        if (lat_between1 != null) {
            c.andLatBetween(lat_between1, lat_between2);
        }
        if (lat_notBetween1 != null) {
            c.andLatNotBetween(lat_notBetween1, lat_notBetween2);
        }
        String pinYin_null = TypeCast.getString(areaMap.get("pinYin_null"));
        String pinYin_notNull = TypeCast.getString(areaMap.get("pinYin_notNull"));
        String pinYin = TypeCast.getString(areaMap.get("pinYin"));
        String pinYin_not = TypeCast.getString(areaMap.get("pinYin_not"));
        String pinYin_greater = TypeCast.getString(areaMap.get("pinYin_greater"));
        String pinYin_greaterEqual = TypeCast.getString(areaMap.get("pinYin_greaterEqual"));
        String pinYin_less = TypeCast.getString(areaMap.get("pinYin_less"));
        String pinYin_lessEqual = TypeCast.getString(areaMap.get("pinYin_lessEqual"));
        String pinYin_like = TypeCast.getString(areaMap.get("pinYin_like"));
        String pinYin_notLike = TypeCast.getString(areaMap.get("pinYin_notLike"));
        List<String> pinYin_in = TypeCast.getStringList(areaMap.get("pinYin_in"));
        List<String> pinYin_notIn = TypeCast.getStringList(areaMap.get("pinYin_notIn"));
        String pinYin_between1 = TypeCast.getString(areaMap.get("pinYin_between1"));
        String pinYin_between2 = TypeCast.getString(areaMap.get("pinYin_between2"));
        String pinYin_notBetween1 = TypeCast.getString(areaMap.get("pinYin_notBetween1"));
        String pinYin_notBetween2 = TypeCast.getString(areaMap.get("pinYin_notBetween2"));

        if (pinYin_null != null) {
            c.andPinYinIsNull();
        }
        if (pinYin_notNull != null) {
            c.andPinYinIsNotNull();
        }
        if (pinYin != null) {
            c.andPinYinEqualTo(pinYin);
        }
        if (pinYin_not != null) {
            c.andPinYinNotEqualTo(pinYin_not);
        }
        if (pinYin_greater != null) {
            c.andPinYinGreaterThan(pinYin_greater);
        }
        if (pinYin_greaterEqual != null) {
            c.andPinYinGreaterThanOrEqualTo(pinYin_greaterEqual);
        }
        if (pinYin_less != null) {
            c.andPinYinLessThan(pinYin_less);
        }
        if (pinYin_lessEqual != null) {
            c.andPinYinLessThanOrEqualTo(pinYin_lessEqual);
        }
        if (pinYin_like != null) {
            c.andPinYinLike(pinYin_like);
        }
        if (pinYin_notLike != null) {
            c.andPinYinNotLike(pinYin_notLike);
        }
        if (pinYin_in != null) {
            c.andPinYinIn(pinYin_in);
        }
        if (pinYin_notIn != null) {
            c.andPinYinNotIn(pinYin_notIn);
        }
        if (pinYin_between1 != null) {
            c.andPinYinBetween(pinYin_between1, pinYin_between2);
        }
        if (pinYin_notBetween1 != null) {
            c.andPinYinNotBetween(pinYin_notBetween1, pinYin_notBetween2);
        }
        if (areaMap.get("orderBy") != null) {
            areaEx.setOrderByClause((String) areaMap.get("orderBy"));
        }
        if (limitStart != null && limitOffset != null) {
            areaEx.setLimitStart(limitStart);
            areaEx.setLimitOffset(limitOffset);
        }

        return areaEx;
    }
}
